/*
 * Selling Partner API for Orders
 * Use the Orders Selling Partner API to programmatically retrieve order information. With this API, you can develop fast, flexible, and custom applications to manage order synchronization, perform order research, and create demand-based decision support tools.   _Note:_ For the JP, AU, and SG marketplaces, the Orders API supports orders from 2016 onward. For all other marketplaces, the Orders API supports orders for the last two years (orders older than this don't show up in the response).
 *
 * OpenAPI spec version: v0
 * 
 *
 * NOTE: This class is auto generated by the swagger code generator program.
 * https://github.com/swagger-api/swagger-codegen.git
 * Do not edit the class manually.
 */


package io.swagger.client.model;

import java.util.Objects;
import java.util.Arrays;
import com.google.gson.TypeAdapter;
import com.google.gson.annotations.JsonAdapter;
import com.google.gson.annotations.SerializedName;
import com.google.gson.stream.JsonReader;
import com.google.gson.stream.JsonWriter;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import io.swagger.client.model.FulfillmentLocation;
import io.swagger.client.model.FulfillmentPlanItem;
import io.swagger.client.model.ShippingInstructions;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;

/**
 * A collection of order items that are to be fulfilled from the same location with the same shipping, pickup, and service instructions.
 */
@ApiModel(description = "A collection of order items that are to be fulfilled from the same location with the same shipping, pickup, and service instructions.")
@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaClientCodegen", date = "2024-09-20T09:03:02.625+08:00")
public class FulfillmentPlan {
  @SerializedName("FulfillmentPlanId")
  private String fulfillmentPlanId = null;

  @SerializedName("CreationDate")
  private String creationDate = null;

  /**
   * Type of fulfillment
   */
  @JsonAdapter(FulfillmentTypeEnum.Adapter.class)
  public enum FulfillmentTypeEnum {
    INSTORE_PICKUP("INSTORE_PICKUP"),
    
    SERVICE("SERVICE"),
    
    SHIP("SHIP");

    private String value;

    FulfillmentTypeEnum(String value) {
      this.value = value;
    }

    public String getValue() {
      return value;
    }

    @Override
    public String toString() {
      return String.valueOf(value);
    }

    public static FulfillmentTypeEnum fromValue(String text) {
      for (FulfillmentTypeEnum b : FulfillmentTypeEnum.values()) {
        if (String.valueOf(b.value).equals(text)) {
          return b;
        }
      }
      return null;
    }

    public static class Adapter extends TypeAdapter<FulfillmentTypeEnum> {
      @Override
      public void write(final JsonWriter jsonWriter, final FulfillmentTypeEnum enumeration) throws IOException {
        jsonWriter.value(enumeration.getValue());
      }

      @Override
      public FulfillmentTypeEnum read(final JsonReader jsonReader) throws IOException {
        String value = jsonReader.nextString();
        return FulfillmentTypeEnum.fromValue(String.valueOf(value));
      }
    }
  }

  @SerializedName("FulfillmentType")
  private FulfillmentTypeEnum fulfillmentType = null;

  /**
   * The fulfillment plan status.
   */
  @JsonAdapter(FulfillmentPlanStatusEnum.Adapter.class)
  public enum FulfillmentPlanStatusEnum {
    ACTIVE("ACTIVE"),
    
    ABORTED("ABORTED"),
    
    COMPLETED("COMPLETED"),
    
    PARTIALLY_FULFILLED("PARTIALLY_FULFILLED");

    private String value;

    FulfillmentPlanStatusEnum(String value) {
      this.value = value;
    }

    public String getValue() {
      return value;
    }

    @Override
    public String toString() {
      return String.valueOf(value);
    }

    public static FulfillmentPlanStatusEnum fromValue(String text) {
      for (FulfillmentPlanStatusEnum b : FulfillmentPlanStatusEnum.values()) {
        if (String.valueOf(b.value).equals(text)) {
          return b;
        }
      }
      return null;
    }

    public static class Adapter extends TypeAdapter<FulfillmentPlanStatusEnum> {
      @Override
      public void write(final JsonWriter jsonWriter, final FulfillmentPlanStatusEnum enumeration) throws IOException {
        jsonWriter.value(enumeration.getValue());
      }

      @Override
      public FulfillmentPlanStatusEnum read(final JsonReader jsonReader) throws IOException {
        String value = jsonReader.nextString();
        return FulfillmentPlanStatusEnum.fromValue(String.valueOf(value));
      }
    }
  }

  @SerializedName("FulfillmentPlanStatus")
  private FulfillmentPlanStatusEnum fulfillmentPlanStatus = null;

  @SerializedName("LastStatusUpdateDate")
  private String lastStatusUpdateDate = null;

  @SerializedName("FulfillmentLocation")
  private FulfillmentLocation fulfillmentLocation = null;

  @SerializedName("ShippingInstructions")
  private ShippingInstructions shippingInstructions = null;

  @SerializedName("FulfillmentPlanItems")
  private List<FulfillmentPlanItem> fulfillmentPlanItems = new ArrayList<FulfillmentPlanItem>();

  public FulfillmentPlan fulfillmentPlanId(String fulfillmentPlanId) {
    this.fulfillmentPlanId = fulfillmentPlanId;
    return this;
  }

   /**
   * Unique identifier for a fulfillment plan.
   * @return fulfillmentPlanId
  **/
  @ApiModelProperty(required = true, value = "Unique identifier for a fulfillment plan.")
  public String getFulfillmentPlanId() {
    return fulfillmentPlanId;
  }

  public void setFulfillmentPlanId(String fulfillmentPlanId) {
    this.fulfillmentPlanId = fulfillmentPlanId;
  }

  public FulfillmentPlan creationDate(String creationDate) {
    this.creationDate = creationDate;
    return this;
  }

   /**
   * Time when the fulfillment plan was created in [ISO 8601](https://developer-docs.amazon.com/sp-api/docs/iso-8601) format.
   * @return creationDate
  **/
  @ApiModelProperty(required = true, value = "Time when the fulfillment plan was created in [ISO 8601](https://developer-docs.amazon.com/sp-api/docs/iso-8601) format.")
  public String getCreationDate() {
    return creationDate;
  }

  public void setCreationDate(String creationDate) {
    this.creationDate = creationDate;
  }

  public FulfillmentPlan fulfillmentType(FulfillmentTypeEnum fulfillmentType) {
    this.fulfillmentType = fulfillmentType;
    return this;
  }

   /**
   * Type of fulfillment
   * @return fulfillmentType
  **/
  @ApiModelProperty(required = true, value = "Type of fulfillment")
  public FulfillmentTypeEnum getFulfillmentType() {
    return fulfillmentType;
  }

  public void setFulfillmentType(FulfillmentTypeEnum fulfillmentType) {
    this.fulfillmentType = fulfillmentType;
  }

  public FulfillmentPlan fulfillmentPlanStatus(FulfillmentPlanStatusEnum fulfillmentPlanStatus) {
    this.fulfillmentPlanStatus = fulfillmentPlanStatus;
    return this;
  }

   /**
   * The fulfillment plan status.
   * @return fulfillmentPlanStatus
  **/
  @ApiModelProperty(required = true, value = "The fulfillment plan status.")
  public FulfillmentPlanStatusEnum getFulfillmentPlanStatus() {
    return fulfillmentPlanStatus;
  }

  public void setFulfillmentPlanStatus(FulfillmentPlanStatusEnum fulfillmentPlanStatus) {
    this.fulfillmentPlanStatus = fulfillmentPlanStatus;
  }

  public FulfillmentPlan lastStatusUpdateDate(String lastStatusUpdateDate) {
    this.lastStatusUpdateDate = lastStatusUpdateDate;
    return this;
  }

   /**
   * The time when the fulfillment plan&#39;s status was last updated in [ISO 8601](https://developer-docs.amazon.com/sp-api/docs/iso-8601) format.
   * @return lastStatusUpdateDate
  **/
  @ApiModelProperty(required = true, value = "The time when the fulfillment plan's status was last updated in [ISO 8601](https://developer-docs.amazon.com/sp-api/docs/iso-8601) format.")
  public String getLastStatusUpdateDate() {
    return lastStatusUpdateDate;
  }

  public void setLastStatusUpdateDate(String lastStatusUpdateDate) {
    this.lastStatusUpdateDate = lastStatusUpdateDate;
  }

  public FulfillmentPlan fulfillmentLocation(FulfillmentLocation fulfillmentLocation) {
    this.fulfillmentLocation = fulfillmentLocation;
    return this;
  }

   /**
   * Represents the location where the plan is fulfilled.
   * @return fulfillmentLocation
  **/
  @ApiModelProperty(value = "Represents the location where the plan is fulfilled.")
  public FulfillmentLocation getFulfillmentLocation() {
    return fulfillmentLocation;
  }

  public void setFulfillmentLocation(FulfillmentLocation fulfillmentLocation) {
    this.fulfillmentLocation = fulfillmentLocation;
  }

  public FulfillmentPlan shippingInstructions(ShippingInstructions shippingInstructions) {
    this.shippingInstructions = shippingInstructions;
    return this;
  }

   /**
   * The shipping-related information for a delivery.
   * @return shippingInstructions
  **/
  @ApiModelProperty(value = "The shipping-related information for a delivery.")
  public ShippingInstructions getShippingInstructions() {
    return shippingInstructions;
  }

  public void setShippingInstructions(ShippingInstructions shippingInstructions) {
    this.shippingInstructions = shippingInstructions;
  }

  public FulfillmentPlan fulfillmentPlanItems(List<FulfillmentPlanItem> fulfillmentPlanItems) {
    this.fulfillmentPlanItems = fulfillmentPlanItems;
    return this;
  }

  public FulfillmentPlan addFulfillmentPlanItemsItem(FulfillmentPlanItem fulfillmentPlanItemsItem) {
    this.fulfillmentPlanItems.add(fulfillmentPlanItemsItem);
    return this;
  }

   /**
   * The details of the order items that are included in the fulfillment plan.
   * @return fulfillmentPlanItems
  **/
  @ApiModelProperty(required = true, value = "The details of the order items that are included in the fulfillment plan.")
  public List<FulfillmentPlanItem> getFulfillmentPlanItems() {
    return fulfillmentPlanItems;
  }

  public void setFulfillmentPlanItems(List<FulfillmentPlanItem> fulfillmentPlanItems) {
    this.fulfillmentPlanItems = fulfillmentPlanItems;
  }


  @Override
  public boolean equals(java.lang.Object o) {
    if (this == o) {
      return true;
    }
    if (o == null || getClass() != o.getClass()) {
      return false;
    }
    FulfillmentPlan fulfillmentPlan = (FulfillmentPlan) o;
    return Objects.equals(this.fulfillmentPlanId, fulfillmentPlan.fulfillmentPlanId) &&
        Objects.equals(this.creationDate, fulfillmentPlan.creationDate) &&
        Objects.equals(this.fulfillmentType, fulfillmentPlan.fulfillmentType) &&
        Objects.equals(this.fulfillmentPlanStatus, fulfillmentPlan.fulfillmentPlanStatus) &&
        Objects.equals(this.lastStatusUpdateDate, fulfillmentPlan.lastStatusUpdateDate) &&
        Objects.equals(this.fulfillmentLocation, fulfillmentPlan.fulfillmentLocation) &&
        Objects.equals(this.shippingInstructions, fulfillmentPlan.shippingInstructions) &&
        Objects.equals(this.fulfillmentPlanItems, fulfillmentPlan.fulfillmentPlanItems);
  }

  @Override
  public int hashCode() {
    return Objects.hash(fulfillmentPlanId, creationDate, fulfillmentType, fulfillmentPlanStatus, lastStatusUpdateDate, fulfillmentLocation, shippingInstructions, fulfillmentPlanItems);
  }


  @Override
  public String toString() {
    StringBuilder sb = new StringBuilder();
    sb.append("class FulfillmentPlan {\n");
    
    sb.append("    fulfillmentPlanId: ").append(toIndentedString(fulfillmentPlanId)).append("\n");
    sb.append("    creationDate: ").append(toIndentedString(creationDate)).append("\n");
    sb.append("    fulfillmentType: ").append(toIndentedString(fulfillmentType)).append("\n");
    sb.append("    fulfillmentPlanStatus: ").append(toIndentedString(fulfillmentPlanStatus)).append("\n");
    sb.append("    lastStatusUpdateDate: ").append(toIndentedString(lastStatusUpdateDate)).append("\n");
    sb.append("    fulfillmentLocation: ").append(toIndentedString(fulfillmentLocation)).append("\n");
    sb.append("    shippingInstructions: ").append(toIndentedString(shippingInstructions)).append("\n");
    sb.append("    fulfillmentPlanItems: ").append(toIndentedString(fulfillmentPlanItems)).append("\n");
    sb.append("}");
    return sb.toString();
  }

  /**
   * Convert the given object to string with each line indented by 4 spaces
   * (except the first line).
   */
  private String toIndentedString(java.lang.Object o) {
    if (o == null) {
      return "null";
    }
    return o.toString().replace("\n", "\n    ");
  }

}

